package com.dkcrow.spring.transaction.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class AdvisorClass {
	
//	@Pointcut("execution(public void com.dkcrow.spring.transaction.aop.TargetClass.hey())")
	@Pointcut("@annotation(com.dkcrow.spring.anno.MyAnnotation) && execution(* *())")
	public void performance() {
	}

//	@Before("performance()")
//	public void turnOffCellPhones() {
//		System.out.println("before");
//	}
//
//	@AfterReturning("performance()")
//	public void applaud() {
//		System.out.println("CLAP CLAP CLAP CLAP CLAP");
//	}
	
	@Around("performance()")
	public void arroundExe(ProceedingJoinPoint pjp) throws Throwable {
		System.out.println("before execute!!");
		pjp.proceed();
		System.out.println("after execute!!");
	}
	
}